Current Location: Home> Function Categories> gmmktime

gmmktime

Get Unix timestamp for GMT date
Name:gmmktime
Category:Date and time
Programming Language:php
One-line Description:Returns the UNIX timestamp of the GMT date.

Definition and usage

gmmktime() function returns the UNIX timestamp of the GMT date.

Tip: This function is the same as mktime() , the difference is that the passed parameters represent the GMT date.

Example

Returns the UNIX timestamp of the GMT date and then use it to find the days of that date:

 <?php
// Output: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a " . date ( "l" , gmmktime ( 0 , 0 , 0 , 10 , 3 , 1975 ) ) ;
?>

Try it yourself

grammar

 gmmktime ( hour , minute , second , month , day , year , is_dst ) ;
parameter describe
hour Optional. Required hours.
minute Optional. Regulations points.
second Optional. Specified seconds.
month Optional. Required month.
day Optional. Specified days.
year Optional. Specified year.
is_dst

Optional. The parameters always represent the GMT date, so is_dst does not affect the result.

Note: This parameter is deprecated in PHP 5.1.0. Instead, new time zone processing features are used.

Similar Functions
Popular Articles